﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Presentation.Web.MVC.Client.ViewModels
{
    public class MenuStateViewModel
    {

        #region Members



        private readonly Tuple<string, string> _controllerActionPair;



        private readonly IDictionary<Tuple<string, string>, string> _mapControllerActionMenuOption = new Dictionary<Tuple<string, string>, string>()
        {
            // TODO: Create other menuOptions
            {Tuple.Create("Customer".ToUpperInvariant(), "Index".ToUpperInvariant()), "CustomerList".ToUpperInvariant()}
        };



        #endregion Members



        #region Constructors



        public MenuStateViewModel(string controller, string action)
        {
            _controllerActionPair = Tuple.Create(controller.ToUpperInvariant(), action.ToUpperInvariant());
        }



        #endregion Constructors



        #region Methods



        public bool IsCurrentAction(string menuOption)
        {
            string upperOption = menuOption.ToUpperInvariant();

            if (_mapControllerActionMenuOption.ContainsKey(_controllerActionPair))
            {
                return upperOption.Equals(_mapControllerActionMenuOption[_controllerActionPair]);
            }
            else
            {
                return false;
            }
        }



        #endregion Methods


        


        

        

    }
}